<?php
class ErrorController extends BpfController
{
  use ApiTrait;

  public function errorAction($e = null)
  {
    if (Azalea\Config::get('debug')) {
      var_dump($e);
    } else {
      return '功能开发中 <a href="javascript:history.go(-1)">返回</a>';
    }
  }

  public function apiAction($e = null)
  {
    return $this->errorReturn($e->getMessage(), $e->getCode());
  }


  public function errorCLI($e = null)
  {
    var_dump($e->getMessage());
  }
}
